package com.epic.dagger.tutorial;

import java.util.Scanner;
import com.epic.dagger.tutorial.Command.Result;
import com.google.common.annotations.VisibleForTesting;
import jakarta.el.ExpressionFactory;
import jakarta.el.ValueExpression;
import jakarta.servlet.jsp.el.ELException;
import jakarta.servlet.jsp.el.FunctionMapper;
import jakarta.el.Expression;

public class DaggerMain {

    @VisibleForTesting
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        CommandRouterFactory commandRouterFactory = DaggerCommandRouterFactory.create();
        CommandRouterFactory build = DaggerCommandRouterFactory.builder().build();
        CommandRouter commandRouter = commandRouterFactory.router();
        System.out.println("please input command: ");
        while (scanner.hasNextLine()) {
            String cmd = scanner.nextLine();
            if (cmd.equals("exit")){
                System.out.println("end");
                break;
            }
            Result result = commandRouter.route(cmd);
            System.out.println(result.status());
        }
    }
}
